﻿using System;
using System.Collections.Generic;

namespace DG.Common.EF.Logging
{
    public interface ILog<TLogId, TLogCampoId, TLogKeyId, TUsuarioID, TLogTipoId>
        where TLogId : struct  , IComparable<TLogId>
        where TLogCampoId : struct  , IComparable<TLogCampoId>
        where TLogKeyId : struct  , IComparable<TLogKeyId>
        where TUsuarioID : struct  , IComparable<TUsuarioID>
        where TLogTipoId : struct  , IComparable
    {
        // Primitive properties

        TLogId LogId { get; set; }
        TLogTipoId LogTipoId { get; set; }
        string Tabela { get; set; }
        DateTime Hora { get; set; }
        string UsuarioNome { get; set; }
        TUsuarioID UsuarioId { get; set; }
        string IP { get; set; }
        string MachineName { get; set; }
        string WindowsUserName { get; set; }
        string OperatingSystem { get; set; }
        string TipoDoErro { get; set; }
        string DescricaoDoErro { get; set; }

        // Navigation properties

        void AddLogCampo(ILogCampo<TLogId, TLogCampoId, TLogKeyId, TUsuarioID, TLogTipoId> logCampo);
        void AddLogKey(ILogKey<TLogId, TLogCampoId, TLogKeyId, TUsuarioID, TLogTipoId> logKey);

        IEnumerable<ILogKey<TLogId, TLogCampoId, TLogKeyId, TUsuarioID, TLogTipoId>> GetLogKeys();
        IEnumerable<ILogCampo<TLogId, TLogCampoId, TLogKeyId, TUsuarioID, TLogTipoId>> GetLogCampos();
    }
}